package com.study.Controller;

import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述:
 *
 * @author Ychiha
 * @version 1.0
 * @date 14/1/2022 下午6:49
 */
@RestController
@RequestMapping("/user")    //因为资源配置处配置了antMatchers("/user/**"); 标志该Controller下的资源由资源配置负责放行
public class UserController {

    /**
     * 获取当前用户
     * @param authentication
     * @return
     */
    @RequestMapping("/getCurrentUser")
    public Object getCurrentUser(Authentication authentication){
        return authentication;
    }
}
